/*
 * AsesorView.java
 */
package asesor;

import org.jdesktop.application.Action;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import java.io.PipedOutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.JDialog;
import javax.swing.JFrame;

/**
 * The application's main frame.
 */
public class Asesor extends FrameView {

    AsesorSONY asesorSony;
    AsesorDELL asesorDell;
    AsesorAPPLE asesorApple;
    AsesorLENOVO asesorLenovo;
    LanzadorJess jessExtender;

    public Asesor(SingleFrameApplication app) {
        super(app);
        PipedOutputStream pout = null;
        jessExtender = new LanzadorJess();
        initComponents();
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = AsesorApp.getApplication().getMainFrame();
            aboutBox = new AsesorAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        AsesorApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        seleccionPropioRadioButton = new javax.swing.JRadioButton();
        seleccionPredefRadioButton = new javax.swing.JRadioButton();
        ConfiguracionComboBox = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        panelCaracteristicas = new javax.swing.JPanel();
        marcasComboBox = new javax.swing.JComboBox();
        MarcaCheckBox = new javax.swing.JCheckBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel2 = new javax.swing.JPanel();
        PantallaCheckBox = new javax.swing.JCheckBox();
        RAMCheckBox = new javax.swing.JCheckBox();
        precioMinText = new javax.swing.JTextField();
        precioMaximoText = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        pantallaMinText = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        pantallaMaximoText = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        ramMinText = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        ramMaximoText = new javax.swing.JTextField();
        vCPUCheckBox = new javax.swing.JCheckBox();
        garantiaCheckBox = new javax.swing.JCheckBox();
        bateriaCheckBox = new javax.swing.JCheckBox();
        jLabel14 = new javax.swing.JLabel();
        vCPUMinText = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        tarjetaGrafMinText = new javax.swing.JTextField();
        vCPUText = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        discoMinText = new javax.swing.JTextField();
        discoMaximoText = new javax.swing.JTextField();
        discoCheckBox = new javax.swing.JCheckBox();
        jLabel19 = new javax.swing.JLabel();
        tarjetaGrafMaxText = new javax.swing.JTextField();
        tarjetaGrafCheckBox = new javax.swing.JCheckBox();
        PrecioCheckBox = new javax.swing.JCheckBox();
        GarantiaComboBox = new javax.swing.JComboBox();
        tipoBateriaLabel = new javax.swing.JLabel();
        SOComboBox = new javax.swing.JComboBox();
        SOCheckBox = new javax.swing.JCheckBox();
        tipoBateriaLabel1 = new javax.swing.JLabel();
        bateriaComboBox = new javax.swing.JComboBox();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        consultaButton = new javax.swing.JButton();
        frameResultados = new javax.swing.JFrame();
        jScrollPane2 = new javax.swing.JScrollPane();
        areaResultados = new javax.swing.JTextArea();
        buscarGroup = new javax.swing.ButtonGroup();
        dialogoEspera = new javax.swing.JDialog();
        jProgressBar1 = new javax.swing.JProgressBar();

        mainPanel.setName("mainPanel"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        buscarGroup.add(seleccionPropioRadioButton);
        seleccionPropioRadioButton.setSelected(true);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(asesor.AsesorApp.class).getContext().getResourceMap(Asesor.class);
        seleccionPropioRadioButton.setText(resourceMap.getString("seleccionPropioRadioButton.text")); // NOI18N
        seleccionPropioRadioButton.setName("seleccionPropioRadioButton"); // NOI18N
        seleccionPropioRadioButton.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                seleccionPropioRadioButtonFocusGained(evt);
            }
        });

        buscarGroup.add(seleccionPredefRadioButton);
        seleccionPredefRadioButton.setText(resourceMap.getString("seleccionPredefRadioButton.text")); // NOI18N
        seleccionPredefRadioButton.setName("seleccionPredefRadioButton"); // NOI18N
        seleccionPredefRadioButton.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                seleccionPredefRadioButtonFocusGained(evt);
            }
        });

        ConfiguracionComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Uso para videojuegos", "Uso doméstico", "Uso para oficina" }));
        ConfiguracionComboBox.setEnabled(false);
        ConfiguracionComboBox.setName("ConfiguracionComboBox"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(seleccionPropioRadioButton)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(seleccionPredefRadioButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ConfiguracionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(512, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(seleccionPropioRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(seleccionPredefRadioButton)
                    .addComponent(ConfiguracionComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        panelCaracteristicas.setName("panelCaracteristicas"); // NOI18N

        marcasComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Sony VAIO", "DELL", "Apple", "Lenovo" }));
        marcasComboBox.setEnabled(false);
        marcasComboBox.setName("marcasComboBox"); // NOI18N

        MarcaCheckBox.setText(resourceMap.getString("MarcaCheckBox.text")); // NOI18N
        MarcaCheckBox.setName("MarcaCheckBox"); // NOI18N
        MarcaCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MarcaCheckBoxActionPerformed(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N

        PantallaCheckBox.setText(resourceMap.getString("PantallaCheckBox.text")); // NOI18N
        PantallaCheckBox.setName("PantallaCheckBox"); // NOI18N

        RAMCheckBox.setText(resourceMap.getString("RAMCheckBox.text")); // NOI18N
        RAMCheckBox.setName("RAMCheckBox"); // NOI18N

        precioMinText.setText(resourceMap.getString("precioMinText.text")); // NOI18N
        precioMinText.setName("precioMinText"); // NOI18N

        precioMaximoText.setText(resourceMap.getString("precioMaximoText.text")); // NOI18N
        precioMaximoText.setName("precioMaximoText"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        pantallaMinText.setText(resourceMap.getString("pantallaMinText.text")); // NOI18N
        pantallaMinText.setName("pantallaMinText"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        pantallaMaximoText.setText(resourceMap.getString("pantallaMaximoText.text")); // NOI18N
        pantallaMaximoText.setName("pantallaMaximoText"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        ramMinText.setText(resourceMap.getString("ramMinText.text")); // NOI18N
        ramMinText.setName("ramMinText"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        ramMaximoText.setText(resourceMap.getString("ramMaximoText.text")); // NOI18N
        ramMaximoText.setName("ramMaximoText"); // NOI18N

        vCPUCheckBox.setText(resourceMap.getString("vCPUCheckBox.text")); // NOI18N
        vCPUCheckBox.setName("vCPUCheckBox"); // NOI18N

        garantiaCheckBox.setText(resourceMap.getString("garantiaCheckBox.text")); // NOI18N
        garantiaCheckBox.setName("garantiaCheckBox"); // NOI18N

        bateriaCheckBox.setText(resourceMap.getString("bateriaCheckBox.text")); // NOI18N
        bateriaCheckBox.setName("bateriaCheckBox"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        vCPUMinText.setText(resourceMap.getString("vCPUMinText.text")); // NOI18N
        vCPUMinText.setName("vCPUMinText"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        tarjetaGrafMinText.setText(resourceMap.getString("tarjetaGrafMinText.text")); // NOI18N
        tarjetaGrafMinText.setName("tarjetaGrafMinText"); // NOI18N

        vCPUText.setText(resourceMap.getString("vCPUText.text")); // NOI18N
        vCPUText.setName("vCPUText"); // NOI18N

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        discoMinText.setText(resourceMap.getString("discoMinText.text")); // NOI18N
        discoMinText.setName("discoMinText"); // NOI18N

        discoMaximoText.setText(resourceMap.getString("discoMaximoText.text")); // NOI18N
        discoMaximoText.setName("discoMaximoText"); // NOI18N

        discoCheckBox.setText(resourceMap.getString("discoCheckBox.text")); // NOI18N
        discoCheckBox.setName("discoCheckBox"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        tarjetaGrafMaxText.setText(resourceMap.getString("tarjetaGrafMaxText.text")); // NOI18N
        tarjetaGrafMaxText.setName("tarjetaGrafMaxText"); // NOI18N

        tarjetaGrafCheckBox.setText(resourceMap.getString("tarjetaGrafCheckBox.text")); // NOI18N
        tarjetaGrafCheckBox.setName("tarjetaGrafCheckBox"); // NOI18N

        PrecioCheckBox.setText(resourceMap.getString("PrecioCheckBox.text")); // NOI18N
        PrecioCheckBox.setName("PrecioCheckBox"); // NOI18N

        GarantiaComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Garantía 1 año", "Garantía 2 años" }));
        GarantiaComboBox.setName("GarantiaComboBox"); // NOI18N

        tipoBateriaLabel.setText(resourceMap.getString("tipoBateriaLabel.text")); // NOI18N
        tipoBateriaLabel.setName("tipoBateriaLabel"); // NOI18N

        SOComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Windows7_64bits", "MacOsX", "Ubuntu_8.04" }));
        SOComboBox.setName("SOComboBox"); // NOI18N

        SOCheckBox.setText(resourceMap.getString("SOCheckBox.text")); // NOI18N
        SOCheckBox.setName("SOCheckBox"); // NOI18N

        tipoBateriaLabel1.setText(resourceMap.getString("tipoBateriaLabel1.text")); // NOI18N
        tipoBateriaLabel1.setName("tipoBateriaLabel1"); // NOI18N

        bateriaComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Duración estándar", "Duración media", "Larga duración" }));
        bateriaComboBox.setName("bateriaComboBox"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(PrecioCheckBox)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(precioMinText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3)
                                    .addComponent(precioMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2)))
                            .addComponent(discoCheckBox)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel17)
                                    .addComponent(discoMinText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel18)
                                    .addComponent(discoMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(PantallaCheckBox)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4)
                                    .addComponent(pantallaMinText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel5)
                                    .addComponent(pantallaMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(tarjetaGrafCheckBox)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel15)
                                    .addComponent(tarjetaGrafMinText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel14)
                                    .addComponent(tarjetaGrafMaxText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(vCPUCheckBox)
                            .addComponent(RAMCheckBox)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel6)
                                    .addComponent(ramMinText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel7)
                                    .addComponent(ramMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(12, 12, 12)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel19)
                                    .addComponent(vCPUMinText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel16)
                                    .addComponent(vCPUText, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(bateriaCheckBox)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(12, 12, 12)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(tipoBateriaLabel)
                                            .addGroup(jPanel2Layout.createSequentialGroup()
                                                .addGap(5, 5, 5)
                                                .addComponent(SOComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                                    .addComponent(bateriaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(garantiaCheckBox)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(12, 12, 12)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(tipoBateriaLabel1)
                                            .addComponent(GarantiaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                            .addComponent(SOCheckBox))))
                .addContainerGap(657, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(RAMCheckBox)
                            .addComponent(PantallaCheckBox)
                            .addComponent(bateriaCheckBox)
                            .addComponent(garantiaCheckBox))
                        .addGap(7, 7, 7)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(tipoBateriaLabel)
                            .addComponent(tipoBateriaLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ramMinText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bateriaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(GarantiaComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ramMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(PrecioCheckBox)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(pantallaMinText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(pantallaMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(precioMinText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(precioMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addGap(48, 48, 48)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(discoCheckBox)
                            .addComponent(tarjetaGrafCheckBox)
                            .addComponent(vCPUCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addComponent(jLabel15)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(tarjetaGrafMinText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel14)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(tarjetaGrafMaxText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addComponent(jLabel17)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(discoMinText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel18)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(discoMaximoText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel19)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(vCPUMinText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(SOComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel16)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(vCPUText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(SOCheckBox))
                .addContainerGap(84, Short.MAX_VALUE))
        );

        jScrollPane1.setViewportView(jPanel2);

        javax.swing.GroupLayout panelCaracteristicasLayout = new javax.swing.GroupLayout(panelCaracteristicas);
        panelCaracteristicas.setLayout(panelCaracteristicasLayout);
        panelCaracteristicasLayout.setHorizontalGroup(
            panelCaracteristicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCaracteristicasLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelCaracteristicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 965, Short.MAX_VALUE)
                    .addComponent(marcasComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(MarcaCheckBox))
                .addContainerGap())
        );
        panelCaracteristicasLayout.setVerticalGroup(
            panelCaracteristicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelCaracteristicasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(MarcaCheckBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(marcasComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 385, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelCaracteristicas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(24, 24, 24))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelCaracteristicas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(asesor.AsesorApp.class).getContext().getActionMap(Asesor.class, this);
        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        consultaButton.setText(resourceMap.getString("consultaButton.text")); // NOI18N
        consultaButton.setName("consultaButton"); // NOI18N
        consultaButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consultaButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addGap(121, 121, 121)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 892, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                        .addGap(258, 258, 258)
                        .addComponent(consultaButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 500, Short.MAX_VALUE)
                        .addComponent(statusAnimationLabel)
                        .addContainerGap())))
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel))
                .addGap(0, 0, 0)
                .addComponent(consultaButton, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE)
                .addContainerGap())
        );

        frameResultados.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        frameResultados.setTitle(resourceMap.getString("frameResultados.title")); // NOI18N
        frameResultados.setName("frameResultados"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        areaResultados.setColumns(20);
        areaResultados.setRows(5);
        areaResultados.setName("areaResultados"); // NOI18N
        jScrollPane2.setViewportView(areaResultados);

        javax.swing.GroupLayout frameResultadosLayout = new javax.swing.GroupLayout(frameResultados.getContentPane());
        frameResultados.getContentPane().setLayout(frameResultadosLayout);
        frameResultadosLayout.setHorizontalGroup(
            frameResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 734, Short.MAX_VALUE)
        );
        frameResultadosLayout.setVerticalGroup(
            frameResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 405, Short.MAX_VALUE)
        );

        dialogoEspera.setName("dialogoEspera"); // NOI18N

        jProgressBar1.setName("jProgressBar1"); // NOI18N

        javax.swing.GroupLayout dialogoEsperaLayout = new javax.swing.GroupLayout(dialogoEspera.getContentPane());
        dialogoEspera.getContentPane().setLayout(dialogoEsperaLayout);
        dialogoEsperaLayout.setHorizontalGroup(
            dialogoEsperaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dialogoEsperaLayout.createSequentialGroup()
                .addGap(110, 110, 110)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(140, Short.MAX_VALUE))
        );
        dialogoEsperaLayout.setVerticalGroup(
            dialogoEsperaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dialogoEsperaLayout.createSequentialGroup()
                .addContainerGap(181, Short.MAX_VALUE)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(99, 99, 99))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void consultaButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultaButtonActionPerformed
        asesorSony = new AsesorSONY();
        asesorDell = new AsesorDELL();
        asesorApple = new AsesorAPPLE();
        asesorLenovo = new AsesorLENOVO();
        preparaCriterioPredefinido();
        preparaCriterioPrecio();
        preparaCriterioPantalla();
        preparaCriterioRAM();
        preparaCriterioBateria();
        preparaCriterioGarantía();
        preparaCriterioDiscoDuro();
        preparaCriterioTarjetaGraf();
        preparaCriterioCPU();
        preparaCriterioSO();

        boolean buscarSONY = true;
        boolean buscarDELL = true;
        boolean buscarAPPLE = true;
        boolean buscarLENOVO = true;
        if (MarcaCheckBox.isSelected()) {
            int marca = marcasComboBox.getSelectedIndex();
            if (marca == 0) {
                buscarDELL = false;
                buscarAPPLE = false;
                buscarLENOVO = false;
            } else if (marca == 1) {
                buscarSONY = false;
                buscarAPPLE = false;
                buscarLENOVO = false;
            } else if (marca == 2) {
                buscarDELL = false;
                buscarSONY = false;
                buscarLENOVO = false;
            } else {
                buscarDELL = false;
                buscarAPPLE = false;
                buscarSONY = false;
            }

        }
        ArrayList<String> resultado;
        Iterator it;
        areaResultados.setText("");

        if (buscarSONY) {
            jessExtender.reset();
            jessExtender.ejecutarConsulta(asesorSony.getComandos());
            resultado = asesorSony.devolverResulados(jessExtender.getM_rete());
            it = resultado.iterator();
            while (it.hasNext()) {
                areaResultados.append("\n***************************************************************\n");
                areaResultados.append(it.next().toString());
                areaResultados.append("\n***************************************************************\n");
            }
        }

        if (buscarDELL) {
            jessExtender.reset();
            jessExtender.ejecutarConsulta(asesorDell.getComandos());
            resultado = asesorDell.devolverResulados(jessExtender.getM_rete());

            it = resultado.iterator();
            while (it.hasNext()) {
                areaResultados.append("\n***************************************************************\n");
                areaResultados.append(it.next().toString());
                areaResultados.append("\n***************************************************************\n");
            }
        }

        if (buscarAPPLE) {
            jessExtender.reset();
            jessExtender.ejecutarConsulta(asesorApple.getComandos());
            resultado = asesorApple.devolverResulados(jessExtender.getM_rete());

            it = resultado.iterator();
            while (it.hasNext()) {
                areaResultados.append("\n***************************************************************\n");
                areaResultados.append(it.next().toString());
                areaResultados.append("\n***************************************************************\n");
            }
        }

        if (buscarLENOVO) {
            jessExtender.reset();
            jessExtender.ejecutarConsulta(asesorLenovo.getComandos());
            resultado = asesorLenovo.devolverResulados(jessExtender.getM_rete());

            it = resultado.iterator();
            while (it.hasNext()) {
                areaResultados.append("\n***************************************************************\n");
                areaResultados.append(it.next().toString());
                areaResultados.append("\n***************************************************************\n");
            }
        }

        if (areaResultados.getText().isEmpty()) {
            areaResultados.append("\n***************************************************************\n");
            areaResultados.append("NO EXISTEN PORTÁTILES CON LAS CARACTERÍSTICAS INDICADAS");
            areaResultados.append("\n***************************************************************\n");
        }
        frameResultados.setVisible(true);
        frameResultados.pack();
}//GEN-LAST:event_consultaButtonActionPerformed

    private void seleccionPredefRadioButtonFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_seleccionPredefRadioButtonFocusGained
        cambiarEstadoElementos(false);
    }//GEN-LAST:event_seleccionPredefRadioButtonFocusGained

    private void seleccionPropioRadioButtonFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_seleccionPropioRadioButtonFocusGained
        cambiarEstadoElementos(true);
    }//GEN-LAST:event_seleccionPropioRadioButtonFocusGained

    private void MarcaCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MarcaCheckBoxActionPerformed
        if (MarcaCheckBox.isSelected()) {
            marcasComboBox.setEnabled(true);
        } else {
            marcasComboBox.setEnabled(false);
        }
    }//GEN-LAST:event_MarcaCheckBoxActionPerformed

    private void cambiarEstadoElementos(boolean estado) {
        ConfiguracionComboBox.setEnabled(!estado);
        GarantiaComboBox.setEnabled(estado);
        SOComboBox.setEnabled(estado);
        bateriaComboBox.setEnabled(estado);
        marcasComboBox.setEnabled(false);

        MarcaCheckBox.setEnabled(estado);
        MarcaCheckBox.setSelected(false);
        PantallaCheckBox.setEnabled(estado);
        PantallaCheckBox.setSelected(false);
        PrecioCheckBox.setEnabled(estado);
        PrecioCheckBox.setSelected(false);
        RAMCheckBox.setEnabled(estado);
        RAMCheckBox.setSelected(false);
        SOCheckBox.setEnabled(estado);
        SOCheckBox.setSelected(false);
        bateriaCheckBox.setEnabled(estado);
        bateriaCheckBox.setSelected(false);
        discoCheckBox.setEnabled(estado);
        discoCheckBox.setSelected(false);
        garantiaCheckBox.setEnabled(estado);
        garantiaCheckBox.setSelected(false);
        tarjetaGrafCheckBox.setEnabled(estado);
        tarjetaGrafCheckBox.setSelected(false);
        vCPUCheckBox.setEnabled(estado);
        vCPUCheckBox.setSelected(false);

        discoMaximoText.setEnabled(estado);
        discoMinText.setEnabled(estado);
        pantallaMaximoText.setEnabled(estado);
        pantallaMinText.setEnabled(estado);
        precioMaximoText.setEnabled(estado);
        precioMinText.setEnabled(estado);
        ramMaximoText.setEnabled(estado);
        ramMinText.setEnabled(estado);
        tarjetaGrafMaxText.setEnabled(estado);
        tarjetaGrafMinText.setEnabled(estado);
        vCPUMinText.setEnabled(estado);
        vCPUText.setEnabled(estado);
    }

    private void preparaCriterioPredefinido() {
        if (seleccionPredefRadioButton.isSelected()) {
            String busqueda = (String) ConfiguracionComboBox.getSelectedItem();
            if (busqueda.equalsIgnoreCase("uso para videojuegos")) {
                asesorSony.preparaCriterioPredefinido("uso para videojuegos");
            } else if (busqueda.equalsIgnoreCase("Uso doméstico")) {
                asesorSony.preparaCriterioPredefinido("Uso doméstico");
            } else {
                asesorSony.preparaCriterioPredefinido("Uso para empresa");
            }
        }
    }

    private void preparaCriterioPrecio() {
        if (PrecioCheckBox.isSelected()) {
            double precioMin = Double.parseDouble(precioMinText.getText());
            double precioMax = Double.parseDouble(precioMaximoText.getText());
            asesorSony.preparaCriterioPrecio(precioMin, precioMax);
            asesorDell.preparaCriterioPrecio(precioMin, precioMax);
            asesorApple.preparaCriterioPrecio(precioMin, precioMax);
            asesorLenovo.preparaCriterioPrecio(precioMin, precioMax);
        }
    }

    private void preparaCriterioPantalla() {
        if (PantallaCheckBox.isSelected()) {
            double pantallaMin = Double.parseDouble(pantallaMinText.getText());
            double pantallaMax = Double.parseDouble(pantallaMaximoText.getText());
            asesorSony.preparaCriterioPantalla(pantallaMin, pantallaMax);
            asesorDell.preparaCriterioPantalla(pantallaMin, pantallaMax);
            asesorApple.preparaCriterioPantalla(pantallaMin, pantallaMax);
            asesorLenovo.preparaCriterioPantalla(pantallaMin, pantallaMax);
        }
    }

    private void preparaCriterioRAM() {
        if (RAMCheckBox.isSelected()) {
            int RAMMin = Integer.parseInt(ramMinText.getText());
            int RAMMax = Integer.parseInt(ramMaximoText.getText());
            asesorSony.preparaCriterioRAM(RAMMin, RAMMax);
            asesorDell.preparaCriterioRAM(RAMMin, RAMMax);
            asesorApple.preparaCriterioRAM(RAMMin, RAMMax);
            asesorLenovo.preparaCriterioRAM(RAMMin, RAMMax);
        }
    }

    private void preparaCriterioBateria() {
        if (bateriaCheckBox.isSelected()) {
            int batMin = 2;
            int batMax = 3;
            if (bateriaComboBox.getSelectedIndex() == 1) {
                batMin = 3;
                batMax = 4;
            } else if (bateriaComboBox.getSelectedIndex() == 2) {
                batMin = 4;
                batMax = 15;
            }
            asesorSony.preparaCriterioBateria(batMin, batMax);
            asesorDell.preparaCriterioBateria(batMin, batMax);
            asesorApple.preparaCriterioBateria(batMin, batMax);
            asesorLenovo.preparaCriterioBateria(batMin, batMax);
        }
    }

    private void preparaCriterioGarantía() {
        if (garantiaCheckBox.isSelected()) {
            int garantiaMin = 1;
            if (GarantiaComboBox.getSelectedIndex() == 1) {
                garantiaMin = 2;
            }
            asesorSony.preparaCriterioGarantía(garantiaMin);
            asesorDell.preparaCriterioGarantía(garantiaMin);
            asesorApple.preparaCriterioGarantía(garantiaMin);
            asesorLenovo.preparaCriterioGarantía(garantiaMin);
        }
    }

    private void preparaCriterioDiscoDuro() {
        if (discoCheckBox.isSelected()) {
            int discoMin = Integer.parseInt(discoMinText.getText());
            int discoMax = Integer.parseInt(discoMaximoText.getText());
            asesorSony.preparaCriterioDiscoDuro(discoMin, discoMax);
            asesorDell.preparaCriterioDiscoDuro(discoMin, discoMax);
            asesorApple.preparaCriterioDiscoDuro(discoMin, discoMax);
            asesorLenovo.preparaCriterioDiscoDuro(discoMin, discoMax);
        }
    }

    private void preparaCriterioTarjetaGraf() {
        if (tarjetaGrafCheckBox.isSelected()) {
            int tarjetaMin = Integer.parseInt(tarjetaGrafMinText.getText());
            int tarjetaMax = Integer.parseInt(tarjetaGrafMaxText.getText());
            asesorSony.preparaCriterioTarjetaGraf(tarjetaMin, tarjetaMax);
            asesorDell.preparaCriterioTarjetaGraf(tarjetaMin, tarjetaMax);
            asesorApple.preparaCriterioTarjetaGraf(tarjetaMin, tarjetaMax);
        }
    }

    private void preparaCriterioCPU() {
        if (vCPUCheckBox.isSelected()) {
            double vCPUMin = Double.parseDouble(vCPUMinText.getText());
            double vCPUMax = Double.parseDouble(vCPUText.getText());
            asesorSony.preparaCriterioCPU(vCPUMin, vCPUMax);
            asesorDell.preparaCriterioCPU(vCPUMin, vCPUMax);
            asesorApple.preparaCriterioCPU(vCPUMin, vCPUMax);
            asesorLenovo.preparaCriterioCPU(vCPUMin, vCPUMax);
        }
    }

    private void preparaCriterioSO() {
        if (SOCheckBox.isSelected()) {
            asesorSony.preparaCriterioSO(SOComboBox.getSelectedItem().toString());
            asesorDell.preparaCriterioSO(SOComboBox.getSelectedItem().toString());
            asesorApple.preparaCriterioSO(SOComboBox.getSelectedItem().toString());
            asesorLenovo.preparaCriterioSO(SOComboBox.getSelectedItem().toString());
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox ConfiguracionComboBox;
    private javax.swing.JComboBox GarantiaComboBox;
    private javax.swing.JCheckBox MarcaCheckBox;
    private javax.swing.JCheckBox PantallaCheckBox;
    private javax.swing.JCheckBox PrecioCheckBox;
    private javax.swing.JCheckBox RAMCheckBox;
    private javax.swing.JCheckBox SOCheckBox;
    private javax.swing.JComboBox SOComboBox;
    private javax.swing.JTextArea areaResultados;
    private javax.swing.JCheckBox bateriaCheckBox;
    private javax.swing.JComboBox bateriaComboBox;
    private javax.swing.ButtonGroup buscarGroup;
    private javax.swing.JButton consultaButton;
    private javax.swing.JDialog dialogoEspera;
    private javax.swing.JCheckBox discoCheckBox;
    private javax.swing.JTextField discoMaximoText;
    private javax.swing.JTextField discoMinText;
    private javax.swing.JFrame frameResultados;
    private javax.swing.JCheckBox garantiaCheckBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JComboBox marcasComboBox;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JPanel panelCaracteristicas;
    private javax.swing.JTextField pantallaMaximoText;
    private javax.swing.JTextField pantallaMinText;
    private javax.swing.JTextField precioMaximoText;
    private javax.swing.JTextField precioMinText;
    private javax.swing.JTextField ramMaximoText;
    private javax.swing.JTextField ramMinText;
    private javax.swing.JRadioButton seleccionPredefRadioButton;
    private javax.swing.JRadioButton seleccionPropioRadioButton;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JCheckBox tarjetaGrafCheckBox;
    private javax.swing.JTextField tarjetaGrafMaxText;
    private javax.swing.JTextField tarjetaGrafMinText;
    private javax.swing.JLabel tipoBateriaLabel;
    private javax.swing.JLabel tipoBateriaLabel1;
    private javax.swing.JCheckBox vCPUCheckBox;
    private javax.swing.JTextField vCPUMinText;
    private javax.swing.JTextField vCPUText;
    // End of variables declaration//GEN-END:variables
    private JDialog aboutBox;
}
